const router = require('koa-router')();
const {db, QueryTypes,} = require("../../models/db");
const tool = require("../../tools/tool");


router.post('/contact/del', async ctx => {
    let tenantId = ctx.user.tenantId
    let id = ctx.request.body.id
    if(!id) return ctx.err('请选择要删除的行')
    let model = await db.models['contact'].findOne({
        where: {
            tenantId,
            id
        }
    })
    if(!model) return ctx.err('未找到数据')
    model.isDel=1
    model.disabled = 1
    await model.save()
    return ctx.suc('已删除')

})




module.exports = router;